﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TinyCinema.Data;
using System.Windows.Input;
using System.Windows;
using System.Windows.Controls;
using System.Collections.ObjectModel;
using TinyCinema.Bussiness;

namespace TinyCinema.Bussiness.AdminPanel
{
    public class Feature: DependencyObject
    {
        public static DependencyProperty lstFeatureProperty = DependencyProperty.Register("lstFeature", typeof(ObservableCollection<Data.Feature>), typeof(Feature));
        public ObservableCollection<Data.Feature> lstFeature
        {
            get { return (ObservableCollection<Data.Feature>)GetValue(lstFeatureProperty); }
            set
            {
                SetValue(lstFeatureProperty, value);
            }
        }
        public ICommand SaveCommand { get; set; }
        public Feature()
        {
            lstFeature = Data.Feature.GetAllFeatures();
            SaveCommand = new RelayCommand<Data.Feature>(
                 (s) => true,
                 (s) =>
                 {

                     if (s != null)
                     {
                         try { s.Save(); }
                         catch { }
                     }
                 });
        }
    }
}
